package uit.edu.vn.Activity;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;

public class RestoreActivity extends Activity{


	public String listArrayRestore[]={"Phục Hồi Tập Tin ","Phục Hồi Danh Bạ","Phục Hồi Tin Nhắn "};
	private Context context ;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.restore);
		context= getBaseContext();
		ListView listview_Restore= (ListView)findViewById(R.id.restorelist);
		listview_Restore.setAdapter(new ArrayAdapter<String>(context,R.layout.row_infomain,R.id.txt_text,listArrayRestore));
		listview_Restore.setTextFilterEnabled(true);
		listview_Restore.setOnItemClickListener(new OnItemClickListener() 
		{
			@Override
			public void onItemClick(AdapterView<?> arg0, View arg1, int position,
					long arg3) {
				// TODO Auto-generated method stub
				// TODO Auto-generated method stub
				// xu ly goi filerestore ,contact restore ,sms restore 
				Intent i;
				if(position==0)
				{
					//ShowToast(String.valueOf(position) );
					// goi FileRestoreActivity
					i= new Intent().setClass(context, FileRestoreActivity.class);
					startActivity(i);
				
				}
				else if(position==1)
				{
					//goi contact view
					i= new Intent().setClass(context, ContactRestoreActivity.class);
					startActivity(i);
				}
				else  
				{
					//Goi smsview
					i= new Intent().setClass(context, SMSRestoreActivity.class);
					startActivity(i);
				}	
			}
		});
	}
}
